﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations.Schema;

namespace S4Store.Domain.NetMarketingKpi
{
    public class NetMarketingKpiMonthConfig
    {
        public int Id { get; set; }

        /// <summary>
        /// 是否确认
        /// </summary>
        public bool IsConfirmed { get; set; }
        /// <summary>
        /// 月
        /// </summary>
        public DateTime Month { get; set; }

        /// <summary>
        /// 店
        /// </summary>
        public int StoreId { get; set; }

        /// <summary>
        /// 店
        /// </summary>
        public virtual Store Store { get; set; }

        /// <summary>
        /// 电销目标
        /// </summary>
        public int DXMB { get; set; }

        /// <summary>
        /// 下线转化率目标
        /// </summary>
        public decimal XXZHLVMB { get; set; }

        /// <summary>
        /// 上月电销成交率
        /// </summary>
        public decimal SYDXSJLV { get; set; }

        /// <summary>
        /// 月度预算
        /// </summary>
        public decimal YDYS { get; set; }

        /// <summary>
        /// 来店量目标
        /// </summary>
        [NotMapped]
        public int LDLMB
        {
            get
            {
                if (SYDXSJLV == 0) return DXMB;
                return (DXMB * 100 / SYDXSJLV).AutoRound();
            }
        }

        /// <summary>
        /// 信息获取目标
        /// </summary>
        [NotMapped]
        public int XXHQMB
        {
            get
            {
                if (XXZHLVMB == 0) return LDLMB;
                return (LDLMB*100 / XXZHLVMB).AutoRound();
            }
        }
    }
}
